A linear time algorithm for binary tree sequences transformation using left-arm and right-arm rotations
نویسندگان
چکیده
In this paper we consider a transformation on binary trees using new types of rotations. Each of the newly proposed rotations is permitted only at nodes on the left-arm or the right-arm of a tree. Consequently, we develop a linear time algorithm with at most n− 1 rotations for converting weight sequences between any two binary trees. In particular, from an analysis of aggregate method for a sequence of rotations, each rotation of the proposed algorithm can be performed in a constant amortized time. Next, we show that a specific directed rooted tree called rotation tree can be constructed using one of the new type rotations. As a by-product, a naive algorithm for enumerating weight sequences of binary trees in lexicographic order can be implemented by traversing the rotation tree.
منابع مشابه
بررسی میزان و نوع ارتباط بین اندازه دور بازو با وزن (جهت تخمین وزن) در افراد بالغ و سالم ساکن شهر تهران
The present survey is a correlation study designed to determine extent and type of relation between mid-arm circumference and weight in order to offer a scale for assumption of weight. 390 healthy, adults who are resident in Tehran and between the ages 18-65 were selected from visitors at three hospital censers at random. Input accumulation was carried out by means of a questionnaire an...
متن کاملA Loopless Algorithm for Generating Multiple Binary Tree Sequences Simultaneously
Pallo and Wu et al. respectively introduced the left-weight sequences (LW-sequences) and right-weight sequences (RW-sequences) for representing binary trees. In this paper, we introduce two new types of binary tree sequences called the left-child sequences (LC-sequences) and right-child sequences (RC-sequences). Next, we propose a loopless algorithm associated with rotations of binary trees for...
متن کاملAn Optimal Rotation Distance Set
A rotation in a binary tree is a local restructuring that changes the tree into another and preserves the inorder sequence. The rotation distance between two binary trees is the minimum number of rotations needed to transform one into another. However, a polynomial-time algorithm for computing rotation distances between any two binary trees has still not been found. Lucas (The Computer Journal,...
متن کاملAn improved algorithm to reconstruct a binary tree from its inorder and postorder traversals
It is well-known that, given inorder traversal along with one of the preorder or postorder traversals of a binary tree, the tree can be determined uniquely. Several algorithms have been proposed to reconstruct a binary tree from its inorder and preorder traversals. There is one study to reconstruct a binary tree from its inorder and postorder traversals, and this algorithm takes running time of...
متن کاملRobot Arm Performing Writing through Speech Recognition Using Dynamic Time Warping Algorithm
This paper aims to develop a writing robot by recognizing the speech signal from the user. The robot arm constructed mainly for the disabled people who can’t perform writing on their own. Here, dynamic time warping (DTW) algorithm is used to recognize the speech signal from the user. The action performed by the robot arm in the environment is done by reducing the redundancy which frequently fac...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Theor. Comput. Sci.
دوره 355 شماره
صفحات -
تاریخ انتشار 2006